package com.example.demo.pojo;

import com.example.demo.jenkins.JenkinsConnect;
import com.offbytwo.jenkins.JenkinsServer;

public enum ModelFactory {

    INSTANCE;
    private JenkinsServer jenkinsServer;

    /**
     * 通过enum实现单例模式，在高并发情况下表现良好
     */
    ModelFactory(){
        jenkinsServer = JenkinsConnect.connectJenkins();
    }

    public JenkinsServer getJenkinsServer(){
        return jenkinsServer;
    }
}
